//导入模块
import { load } from "/code/web/util/LoadView.js"
//
load("productService")
function aaa() {
    let res = fetch("http://localhost:3000/products").then(res => res.json())
        .then(res => {
            document.querySelector(".carousel-inner").innerHTML = res.map(item => {
                return `<div class="carousel-item ${item.id == 1 ? "active" : ""}">
                    <img src="${item.imageUrl}" class="d-block w-100" alt="图片" >
                    <div class="carousel-caption d-none d-md-block">
                    <h5>${item.title}</h5>
                    <p>${item.discription}</p>
                    </div>
                    </div>`
            }).join("")
        })

}
aaa()